{% extends "admin/base_site.html" %}
{% load i18n static %}

{% block content %}
<div id="content-main">
  <h1>{% translate '管理日志' %}</h1>
  <table class="table">
    <thead>
      <tr>
        <th>{% translate '时间' %}</th>
        <th>{% translate 'User' %}</th>
        <th>{% translate 'Action' %}</th>
        <th>{% translate '对象' %}</th>
      </tr>
    </thead>
    <tbody>
      {% for log in logs %}
      <tr>
        <td>{{ log.action_time|date:"Y-m-d H:i" }}</td>
        <td>{{ log.user.last_name }}{{ log.user.first_name }} </td>
        <td>{{ log.get_action_flag_display }}</td>
        <td>
          {% if log.content_type and log.object_repr %}
          {{ log.content_type }}: {{ log.object_repr }}
          {% else %}
          {% translate 'None' %}
          {% endif %}
        </td>
      </tr>
      {% empty %}
      <tr>
        <td colspan="4">{% translate 'No logs available.' %}</td>
      </tr>
      {% endfor %}
    </tbody>
  </table>
</div>
{% endblock %}